package com.mifengkong.frwidget.banner.customerbanner;

import android.support.v4.view.ViewPager;
import android.view.View;

/**
 * Created by jiangyongxing on 2017/8/13.
 * 描述：
 */

public abstract class BannerAdapter {

    /**
     * 根据位置获取view
     *
     * @param position
     * @return
     */
    public abstract View getView(int position, View convertView);

    /**
     * 获取轮播的数量
     *
     * @return
     */
    public abstract int getCount();

    /**
     * 广告位的描述
     *
     * @return
     */
    public String getBannerDesc() {
        return "";
    }

    public ViewPager.PageTransformer getPageTransformer() {
        return new ViewPager.PageTransformer() {
            @Override
            public void transformPage(View page, float position) {

            }
        };
    }

    /**
     * 是否需要无限循环
     * @return
     */
    public boolean needInfiniteLoop() {
        return true;
    }
}
